package com.dcm.seckill.cilent;

import com.dcm.common.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 牛浩
 */
@FeignClient("dcm-item")
public interface ItemClient {
    /**
     * 查询
     * @return
     */
    @RequestMapping(value = "/item/findAll",method = RequestMethod.GET)
    CommonResponse findAll();

    /**
     * 远程调用item根据id查询数据
     * @param id
     * @return
     */
    @RequestMapping(value = "/item/findItemById",method = RequestMethod.GET)
    public CommonResponse findItemById(@RequestParam("id") Long id);

    /**
     * 远程调用 模糊查询
     * @param specId
     * @param id
     * @param itemName
     * @return
     */
    @RequestMapping(value = "/item/searchItem")
    CommonResponse searchItem(@RequestParam("specId")Integer specId,
                                @RequestParam("id") Long id,
                                @RequestParam("itemName") String itemName);
}
